package watch

import (
	"time"

	"github.com/gorilla/websocket"
)

type state int32

const (
	first state = iota
	noSleep
	sleep
)

type client struct {
	id       string
	ws       *websocket.Conn
	fid      string
	last     time.Time
	state    state
	interval int32
}

func newClient(id string, ws *websocket.Conn) *client {
	return &client{
		id:   id,
		ws:   ws,
		last: time.Now(),
	}
}

func (p *client) setFile(fid string, interval int32) {
	p.fid = fid
	p.interval = interval
	p.last = time.Now()
}
